package com.bluetooth;

import java.io.OutputStream;


/**
 * 发送信息的线程类
 * Created by Administrator on 2017/9/26.
 */

public class SendThread extends  Thread {

    private String message; //要发送的信息
    private OutputStream out;
    public SendThread(OutputStream out,String message)
    {
        this.message=message;
        this.out=out;
    }
    private void sendMessage()
    {
        try{
            out.write(message.getBytes("utf-8"));
            out.flush();
        } catch (Exception e){
        }
    }
    @Override
    public void run() {
        sendMessage();

    }
}
